45dc09912f6a79a38654d1a5efa6064b4500d08a,src/test/java/mousio/etcd4j/responses/EtcdKeysResponseParserTest.java,EtcdKeysResponseParserTest,testParseGetKey,#,37

Before Change



  @Test
  public void testParseGetKey() throws Exception {
    final EtcdKeysResponse action = parseJsonResponse("{\n" +
        "    \"action\": \"get\",\n" +
        "    \"node\": {\n" +
        "        \"createdIndex\": 2,\n" +
        "        \"key\": \"/message\",\n" +
        "        \"modifiedIndex\": 2,\n" +
        "        \"value\": \"Hello world\"\n" +
        "    }\n" +
        "}");

    assertEquals(EtcdKeyAction.get, action.action());
    assertEquals(2, action.node().createdIndex());

After Change



  @Test
  public void testParseGetKey() throws Exception {
    EtcdKeysResponse action = parse(headers, Unpooled.copiedBuffer(("{\n" +
        "    \"action\": \"get\",\n" +
        "    \"node\": {\n" +
        "        \"createdIndex\": 2,\n" +
        "        \"key\": \"/message\",\n" +
        "        \"modifiedIndex\": 2,\n" +
        "        \"value\": \"Hello world\"\n" +
        "    }\n" +
        "}").getBytes()));

    assertEquals(EtcdKeyAction.get, action.action);
    assertEquals(2, action.node.createdIndex.intValue());